import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import nl.captcha.*;
import nl.captcha.servlet.*;
import nl.captcha.backgrounds.*;
import nl.captcha.text.producer.*;
 public class MyCaptchaServlet extends SimpleCaptchaServlet
{
    @Override
    //one change done by me.
    //second change done by me.
	//Third change done by me
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {
	char str[]=new char[62];
	for(int i=97;i<123;i++)
	str[i-97]=(char)i;
	for(int i=65;i<91;i++)
	str[26+i-65]=(char)i;
	for(int i=48;i<58;i++)
	str[52+i-48]=(char)i;
 Captcha captcha = new Captcha.Builder(250,40).addText(new DefaultTextProducer(8,str)).addBorder().gimp().addBackground(new GradiatedBackgroundProducer()).addNoise().build();

        CaptchaServletUtil.writeImage(response, captcha.getImage());

        request.getSession().setAttribute(Captcha.NAME, captcha);
		}
		}